﻿#include "querywin.h"
#include "ui_querywin.h"
#include "faceproject.h"
#include <QPainter>
#include <QSqlRecord>
#include <opencv2/opencv.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/face.hpp>

using namespace  cv;
using namespace  cv::face;

queryWIN::queryWIN(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::queryWIN)
{
    ui->setupUi(this);
    this->setWindowFlag(Qt::FramelessWindowHint);

}

queryWIN::~queryWIN()
{
    delete ui;
}

void queryWIN::setUsrInfo(QString name, QString picterpath, QString time)
{
    this->name=name;
    this->picterpath=picterpath;
    this->time=time;
    ui->namelb->setText(name);
    ui->timelb->setText(time);

    //Mat image = imread(picterpath.toStdString());
    //imshow("myimage", image);
   // waitKey(30);



   //

}

void queryWIN::paintEvent(QPaintEvent *e)
{
    //绘图事件
    QPainter painter(this);//创建一个绘图对象，后期绘制在this上
    QPen pen = painter.pen();//获取工具中的画笔
    QImage image(picterpath);
    painter.drawImage(QRectF(1,25,100,100),image, image.rect());

}

void queryWIN::on_pushButton_clicked()
{
    this->close();
}

